estree-util-is-identifier-name
Check if something can be an identifier name.
Install
npm:
npm install estree-util-is-identifier-name
Use
var isIdentifierName = require('estree-util-is-identifier-name')
isIdentifierName.name('$something69')
isIdentifierName.name('69')
isIdentifierName.name('var')
isIdentifierName.start(48)
isIdentifierName.cont(48)
API
isIdentifierName.name(value)
Checks if the given string is a valid identifier name.
isIdentifierName.start(code)
Checks if the given character code can start an identifier.
isIdentifierName.cont(code)
Checks if the given character code can continue an identifier.
Related
License
MIT © Titus Wormer